package com.lxw.mq;


import com.mongodb.client.MongoDatabase;
import com.mongodb.client.gridfs.GridFSBucket;
import com.mongodb.client.gridfs.GridFSBuckets;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.MongoDbFactory;

@SpringBootApplication
public class ConsumerMqApp {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerMqApp.class,args);
    }

    @Bean
    public GridFSBucket gridFSBucket(MongoDbFactory mongoDbFactory){
        MongoDatabase db = mongoDbFactory.getDb();

        return GridFSBuckets.create(db);
    }
}
